package com.burstly.lib.util;

import java.math.BigInteger;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;

public final class Signature
{
  protected static final LoggerExt LOG = LoggerExt.getInstance();
  private static final String LOG_TAG = "Signature";

  public static String getSignature(String paramString1, String paramString2)
  {
    try
    {
      Mac localMac = Mac.getInstance("HmacSHA1");
      localMac.init(new SecretKeySpec(paramString2.getBytes(), "HmacSHA1"));
      String str1 = new BigInteger(1, localMac.doFinal(paramString1.getBytes())).toString(16);
      if (str1.length() % 2 != 0)
        str1 = "0" + str1;
      String str2 = str1.replace("-", "").toLowerCase();
      return str2;
    }
    catch (NoSuchAlgorithmException localNoSuchAlgorithmException)
    {
      LOG.logThrowable("Signature", localNoSuchAlgorithmException);
      return "";
    }
    catch (InvalidKeyException localInvalidKeyException)
    {
      while (true)
        LOG.logThrowable("Signature", localInvalidKeyException);
    }
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.burstly.lib.util.Signature
 * JD-Core Version:    0.6.2
 */